package org.spider.model;

import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
public class DownloadRequest implements Serializable {

    /**下载工具枚举*/
    private DownloadToolEnum downloadToolEnum = DownloadToolEnum.HTTPCLIENT;
    /**请求方式枚举*/
    private HttpMethodEnum httpMethodEnum = HttpMethodEnum.GET;
    /**代理*/
    private DownloadProxy downloadProxy;
    /**链接*/
    private String url;
    /**是否返回字节流*/
    private boolean binaryContent = false;
    /**请求头集合*/
    private List<HttpHeader> httpHeaderList = new ArrayList<>();
    /**请求体*/
    private HttpRequestBody requestBody;
    /**自动化操作流程*/
    private List<Operation> operationList = new ArrayList<>();
    /**请求字符集编码*/
    private String charset = "utf-8";
    /**连接请求超时时间*/
    private int connectionRequestTimeout = 60 * 1000;
    /**socket超时时间*/
    private int socketTimeout = 60 * 1000;
    /**连接超时时间*/
    private int connectTimeout = 60 * 1000;
    /**重定向是否自动处理*/
    private boolean redirectsEnabled = true;
    /**相对的循环重定向是否拒绝*/
    private boolean relativeRedirectsAllowed = false;
    /**失败重试次数*/
    private int retryCount = 3;
    /**循环 重定向是否被允许;*/
    private boolean circularRedirectsAllowed = false;
}
